﻿using System;
using UnityEngine;

namespace UniRx.Triggers
{
	// Token: 0x0200044B RID: 1099
	[DisallowMultipleComponent]
	public class ObservableUpdateTrigger : ObservableTriggerBase
	{
		// Token: 0x06001776 RID: 6006 RVA: 0x00063DB4 File Offset: 0x000621B4
		private void Update()
		{
			if (this.update != null)
			{
				this.update.OnNext(Unit.Default);
			}
		}

		// Token: 0x06001777 RID: 6007 RVA: 0x00063DD4 File Offset: 0x000621D4
		public IObservable<Unit> UpdateAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.update) == null)
			{
				result = (this.update = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x06001778 RID: 6008 RVA: 0x00063DFC File Offset: 0x000621FC
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.update != null)
			{
				this.update.OnCompleted();
			}
		}

		// Token: 0x04000CDF RID: 3295
		private Subject<Unit> update;
	}
}
